class Solution {
    public:
        int divisorSubstrings(int num, int k) {
            long long M = pow(10, k);
            int ans = 0;
            for (int n = num; n >= M / 10; n /= 10) {
                int x = n % M;
                if (x > 0 && num % x == 0) {
                    ans++;
                }
            }
            return ans;
        }
    };